package com.zdw.oauth.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zdw.common.parent.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 部门
 * </p>
 *
 * @author 卓德文
 * @since 2023-07-25
 */
@Getter
@Setter
@TableName("department")
@ApiModel(value = "DepartmentEntity对象", description = "部门")
public class DepartmentEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("部门编码")
    private String code;

    @ApiModelProperty("部门名称")
    private String name;

    @ApiModelProperty("状态(0:启用;1:禁用)")
    private Integer state;

    @ApiModelProperty("上级部门ID")
    private Integer parentId;

    @ApiModelProperty("子部门列表")
    @TableField(exist = false)
    private List<DepartmentEntity> sonList = new ArrayList<>();

}
